-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New version of PR 6788 (JText::_() Optimizations) #11235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Hopefully this is the fastest way to create a new PR with just the changes needed for the JText::_() optimizations from #6788.
| { | ||
| // Interpret \n and \t characters | ||
| $string = str_replace(array('\\\\', '\t', '\n'), array("\\", "\t", "\n"), $string); | ||
| if (strpos($string, '\\') !== false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hum you are replaceing 3 different string but only searching the position of one?
|
Hi Andre, Yes that is correct...I'm only checking for the presence for at least one backslash character (which would show up in all 3 of the cases being checked against for the str_replace call). If there is at least one backslash then we need to process the str_replace call because there's a strong chance it'll be needed. If there isn't at least one backslash then we don't need to process the str_replace call. I believe that covers things correctly. Mainly what I observed was that the vast majority of our language strings do not contain any of those 3 characters so running the str_replace call all of the time on every since language string was unnecessary (and there are lots of these calls). The extra if statement helps to avoid them with the faster strpos check. |
|
I have tested this item ✅ successfully on c96e2a8 This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11235. |
1 similar comment
|
I have tested this item ✅ successfully on c96e2a8 This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11235. |
|
RTC This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11235. |
* re-arrayhelper-min: (2467 commits) Minimize JArrayHelper methods `toInteger`, `pivot`, `arrayUnique` by using Joomla\Utilities\ArrayHelper internally. Leaving (reverting from joomla#7782) other four methods as is for b/c reasons as mentioned in joomla#8455. remove platform include (joomla#11615) [GitHub Templates] Make headings bigger (joomla#11607) [com_contact] Make ACL core.edit.own work (PR for 11466) (joomla#11503) Small review on docs & code structure in JModelLegacy library classes (joomla#11057) Obviously, this should be an array. (joomla#11610) Don't manually import JPlatform anymore (joomla#10841) Parse preprocess rules from component routers (joomla#8986) Add the correct exception after 11593 merge (was waiting for that merrge) (joomla#11606) Add missing clean line after joomla#9277 (joomla#11605) Deprecate the _PROFILER global var (joomla#10845) Spelling errors (joomla#11604) Moved travis javascript bash file to build/travis like joomla#11600 (joomla#11603) Regression: Fix edit check in backend articles manager, always denying edit after soft deny (joomla#11511) [com_plugins] User not allowed to core.manage? Use 403 php custom exception (instead of a 404 JError) (joomla#11593) [com_newsfeeds] Make ACL core.edit.own work (PR for 11466) (joomla#11502) $result-variable-undefined-given-default-value (joomla#9277) com_banners use exceptions. and not allowed is a 403 (joomla#11418) Frontend & plugins using the autoloader (joomla#10882) New version of PR 6788 (JText::_() Optimizations) (joomla#11235) ...
Hopefully this is the fastest way to create a new PR with just the changes needed for the JText::_() optimizations from joomla#6788.
Hopefully this is the fastest way to create a new PR with just the changes needed for the JText::_() optimizations from joomla#6788.
Pull Request for Issue # .
Summary of Changes
Testing Instructions
Hopefully this is the fastest way to create a new PR with just the changes needed for the JText::_() optimizations from #6788.